package person.learn.controller.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.Map;

/**
 * Created by barton on 16-1-29.
 * 1.测试springboot默认的资源配置时，要注释掉application.yml里边spring.mvc.view.suffix和spring.mvc.view.prefix配置项
 * 2.视图位置对应/resources/templates/velocity/*.vm
 */
@Controller
public class VelocityController {

    @Value("${learn.velocity.message}")
    private String message;

    @RequestMapping("/velocity")
    public String velocity(Map<String, Object> model) {
        model.put("time", new Date());
        model.put("message", message);
        System.out.println("ddd");
        return "velocity/velocitytest";
    }
}
